<?php


namespace app\zmt\validate;


use think\Validate;

class NavValidate extends Validate
{
    protected $rule = [
        'id' => 'require|integer',
        'image' => 'require',
        'title' => 'require|max:10'
    ];
    protected $message = [
        'id.require' => 'id不能为空',
        'image.require' => '图像不能为空',
        'title.require' => '标题不能为空',
        'title.max:10' => '标题最大长度为10'
    ];
    protected $scene = [
        'add' => ['image','title'],
        'edit' => ['id','image','title'],
    ];
}